# -*- coding: utf-8 -*-
####以时间作为文件的编号###
import sys
import os
from time import strftime, localtime

def getTimeIndex():
    year = strftime("%Y",localtime())
    mon  = strftime("%m",localtime())
    day  = strftime("%d",localtime())
    hour = strftime("%H",localtime())
    min  = strftime("%M",localtime())
    sec  = strftime("%S",localtime()) 
    currentTime = year+mon+day+hour+min+sec
    return currentTime

ist={'0':'0','1':'01','2':'02','3':'03','4':'04','5':'05','6':'06','7':'07','8':'08','9':'09'}

def getTimeIndex2(i):
    year = strftime("%Y",localtime())
    mon  = strftime("%m",localtime())
    day  = strftime("%d",localtime())
    hour = strftime("%H",localtime())
    min  = strftime("%M",localtime())
    sec  = strftime("%S",localtime())
    currentTime = year+mon+day+hour+min+sec
    if i>9:
        currentTime+=str(i)
    else:
        currentTime+=ist[str(i)]
    return currentTime

def getPageing(index,page=0):
    s="/%s"
    if page==0:
        if index==16:return (None,"/1")
        else:return (None,None)
    if index==16:
        return ("/",s%(page+1)) if page==1 else (s %(page-1),s%(page+1))
    return ("/",None) if page==1 else (s %(page-1),None)
